<?
include_once("mssql_GenXmlData.php"); 
include_once("inc/conn.php");
$DJTYPE=$_GET["DJTYPE"];
$KEY=$_GET["KEY"];
$report=$_GET['report'];
	$query="SELECT SQL FROM PRINTS WHERE DJTYPE='$DJTYPE' AND content='".$DJTYPE.".grf'";
	$cursor=msquery($msconn,$query);
	if($ROW=mssql_fetch_array($cursor)){
		$QuerySQL = $ROW["SQL"];
		  $QuerySQL = str_replace('JQKEY', $KEY, $QuerySQL);
	}else{
		  $query="SELECT SQL FROM PRINTS WHERE DJTYPE='$DJTYPE' AND content='".$report."'";
		$cursor=msquery($msconn,$query);
		if($ROW=mssql_fetch_array($cursor)){
			$QuerySQL = $ROW["SQL"];
			$QuerySQL = str_replace('JQKEY', $KEY, $QuerySQL);
		}
	}
 
	 GenAttrXmlData($QuerySQL, false);
?>